implement async hooks for factory. Closes #1