Some cleanup
More refactoring