refactored objects into classes