properly handle gateway class param