refactor active_record/instance_methods to reduce complexity