Migrate failover to threshold and add more features