Refactor admin_edit()