created factory for new API