passing params around instead of setting them globally