TODO: Split up addToDictionary method