put tin export into extra function to avoid code duplication
[FileIO/Legacy] Using two spaces instead of tabs.
resolved merge conflicts