Better specified type of result function.