refactor($interval): use clearInterval from $window instead of from global scope