Move admin authentication logic to another file
Eliminate duplication of authentication logic