Refactored factory and removed errant print statement