Issue #2296581 by c.pachabhaiya: Admin fucntion moved to admin file, also fixed some code style errors.