updates product controller code to use best practices