Refactored get_module call
Added purging of old modules