refactor and added admin resource