Concurrence: refactor. add ResourceFactory