Refactor main modules to adhere to PEP8