Refine codes and add additional type