refactored all classes