begin refactoring with OOP