first step to a nicer code style of admin

small bits of refactor here and there