function-izing code