FIX legacy code