some simple refactoring