Some code refactorings in Module Builder