Fix allocation logic
Use object pointers