Minor cleanup and refactoring in manage handlers.