Made timer code more readable