Added timer logic, refactored code