testing and factory