Refactored HA from vovo4ka