some minor refactoring