converted to OO