refactored model into classes and seperate files