some more refactoring..