mask legacy code