Refactor marker/position caching