Moved timer function to module