added a method to get the type of a source