refactor immutable pointers