Updated method and class to return ID as a hash