first small refactoring of admin. still have a lot of work.