refactoring complete. classes implemented