Cleanup based on PSR2, remove unused variables, etc.