You probably can replace the if/else with just @container.stop_gear(exclude_web_proxy: options.exclude_web_proxy...) it will pass nil through, and should work ( I think :) )