Cleanup and streamlined code.