simplify alloc, add statuscode as enum