Refactoring the module database loader