Store and retreive domains and categories  properly.