#76 improved type resolution