Refine the logic in auto-scaling group and scaling policy management