remove usage of alloc / free