Refactoring instaexport into a seperate node module to make it testable