Updated setInterval pattern