use pattern matching to name the variables, easier to guess what are the returned parameters
avoid side effects when inside a closure