Refactoring and "fixing" rearranger.