Instead of referencing a global object (timer), pass it in as an argument