Refactoring into two seperate class files and a parent class