remove un-needed directive and add index to word object