better pointer management