refactor for OO