Move location logic to model
Resolve merge conflicts