refactor params as a function test a bit