refactor as gem, abstract bowtie and readmappings as classes