clean up position data code