Refactor codecs to remove duplication
Remove duplication in UuidFactory