update with function OOP style