minor refactoring and initial gargl template file being written by chrome extension