refactoring, cleanup