Removed all dependancy related to nid and nid-arg. Also build new where query.