fix bug in generating sets on array items and refactor a bit in remotedoc
comment out some incomplete code