Use is

Use the "is" module instead of custom built type detection functions.