implement restricting sync to certain user groups; refactor, code style, improve documentation