Reformatting and refactoring