Refactor edits controller