Repairs automated testing and refactors views