simplify mark_gateway
simplify clientcount