code cleanup and revised verbose output