Export/Import

Export/Import modification + minor code cleanup