Refacoring and some tests with dummy data