improved type assertions