Refactored rest of plotting code into private methods

Also renamed several variables for clarity.