refactor to OO