extract new_record method
extract update_sql and insert_sql methods
extract instance vars method
add example setup