simplify: move params setup to separate function