Further refactoring and suite of integration tests development.