Support multiple backends and add alloc backend

can be struct{} instead of bool