Move admin functions to separate file