- some minor refactoring