Changed design pattern and more testing