refactor towards oop