Refactored way to check for existing products