admin_script refactoring