More versatile (and pythonic) type-handling