move functions to object and update calls to them