refactoring, and other stuff