Double pointer refactoring