Removing duplicated code to initialize params

All tests passed