Performance improvements for position calc

Several times speedup for swap position calc.
implicit? Will the calling function not have a `refData`?