refactored into multiple class files