refactoring and adding admin template