more refactoring!!