Refactor refresh tracks code