Removes redundant if statement in generate_mappings