Refactoring
Saving statistics and updating assay file