Refactor mouse position processing, this feels faster...?