refactoring and more exports