Cleanup, refactoring