Add type deciding method