Remove missing ]
Simplify logic.