Some style improvements

Realized halfway through that I was making style changes to a file I plan to
deprecate. But figured I'd commit it anyways:
Fixed a typo that was breaking this function
Fixed some indentations, and removed sections that will be made dynamically elsewhere.
Style improvements, PEP8 compliance, etc.