no need for zalloc and moved stuff out of spinlock