Added ability to pass a function as a default value