refactored three plotting modules into one