refactored classes, polished all around