added strategy pattern and test