some more refactoring done