Implemented Factory object, this resolves #5