Cleanup view code for docs