Create a factory for store the main logic of the functionality
Managing errors in the view