Got rid of type-casting into isFOO() and toFOO() functions by