moving scripts to admin functions