params fix, cleanup, formatting