I’ve pushed a simplification.  I noticed that booleans are coerced to strings though (and tested), so that behaviour is preserved.  Let me know what you think. :)