separate function from return statement