WIP: add ref_count and change alloc mechanisms