refactoru midterm project