refactor and set update position interval