moved exports code into separate file