Improved module logic.