refactor: remove prevLocation variable