refactor pointers