refactored some classes and added a few new functions