Cleanup duplicate codes
#209

kylekatarnls wants to merge refactor into master

We do not currently have an analysis of these two commits