refactors admin functions into admin namespace - thanks for the help, tests