some code refactoring