Minor code cleanup; simplified some lambadas.