refactor module load mechanism