clean up code in `compileSet`