First refactor of admin controller