Factor out more code into let {} blocks.