added type function to determine the type of internal objects