moved functions and exports to their places