Refactor with parameter object