Updated to handle updating idle time and better control on creating/removing routines.