realizations for generation of constructor and readerWriterr moved to separate functions