begin to refactor to OO version