Refactored products and cart states and added directives