refactoring autoheal