Refactoring mass_insert_options method