clean up code in product controller