Refactored code to use exports