The code from the master branch seems to be tighlty coupled and has low cohesion. Try to refactor it without breaking the tests :)