some refactoring, cleaning up classes