put groups js functions in external file (part 1)