make it possible go from value to enum
fixing up refcounts