update oop class and method instead of function