Centralize position getting and sorting