Refacting code and adding ArrayExporter