Refactor getPointer