make allocate method private