Convert dictionary to classes