Simpler function, no need for closure