big refactoring and admin management improvements