Optimized imports, adopted PEP8 conventions