refactor classes to be more object oriented