Added balance checker and configurable thresholds