Move export code to classes