Cleanup and code reduction.