more refactoring done