some major refactoring, making code more dry, new classes to organize concepts