more refactoring work