better pointer handling