- some code refactoring