cleaned up code in admin template