should be more strict and check `val`'s constructor name.