Cleaning
Factor out common export code...