Removed duplicate code from part of a command (check what changed if you're confused)