Rewrites positioning logic.