Moved the timer code into a dedicated timer.js file for better code readability, and moved it under system