removing nss in document/factory. WIP. Code broken