Refactor to pass around options object rather than args/dict.