refactor linq.js