Refactored patch operations into a separate controller