Implemented primary factory. Closes #19