combining some repetitive admin cli code into a templatized function