Done a part of admin functions, refactor view