Removed some unused code.
Moved admin functions to an admin class.