Pass the class type when getting data. Remove unused method