Removed function argument since fun works

fun is already part of the closure, so it's more concise to use it
directly instead of passing it around.