Refactor centering