added a getTypeByExtension() Method