refactoring to be more oop so can add more complex features