move method function into object with schemas