move code from utils to position.py and update imports as necessary