Add support for passing a function as default