Simplify logic using find_or_create_by