Move all code that sets special pointer to one function.