Created factory for Category and Component creation. Also updated Exception for better error message management.