Refactoring basic operations to using factory;