flatten nested let expressions