moved params closer to where it's used