Fsctory design pattern and tests