using partial functions from functools as callbacks