Improved admin code