More cleanups and tidyups for the module