moving timer to lib