Refactor productcontroller