Refactored all classes to better implement OOP. Based on comments of Lecture 7.