Refactor code to be more object-oriented-true