Tidying up and new export script