Clean up static allocate function in REPRs