Refactor watch loop out form main().