optimized optional params and json output