added a delegate to make allocate more readable