ha policy changes and refactoring