More cleaning
Misc refactoring