Refactor to get rid of a redundant pointer