more refactoring

more refactoring