1. Change method name to invalid? from valid?
2. Correct the shorthand for inheritance of custom errors
3. Optimize condition in invalid? method