refactored to remove a few classes