refactor csv and json export into its own classes