PEP8 and code simplification. Refs #26