Record steps by composing a callback function