formatting and preparation for #149

clean up of code, also looking through for where we can implement #149 and
#138 in the future.