Simplify imports and format in compliance with PEP8