refactor: took apart plotting and creating png file consistently