refactor allocators