fix typed listeners and rewrite timer