Added object type hints
Lots of code style cleanup