Refactor common code into build_with_params method in controller