the same, avoid creating more nested functions IMHO