move module loading to a separate function
simplify