refactor to_a method.
Refactor update and create methods.