factored out an arrow function