cleaned up the way modules are handled internally.