some more refactoring, removing unneccesary code.