getPositions refactored