better way of sub-typing