Refactor into class files