Drop legacy code and rearrange compatibility module.