Fixing formatting, parameterising literals as class or module vars, cleaning up unused imports