Refactoring and storing the visibility for each module