added admin page. along with some refactorings