minor refactoring
more refactoring