Refactoring to get the front-end working again