Add typing, improve naming where necessary
Add typing, improve naming where necessary