refactored some code on the show product view