Refactor - reduce redundancy in seamless looping