Update for supporting different modes.