Restructuring to remove the module pattern