Unnesting some functions