make the reading and writing generic
apply the same structure to sherlock