refactor to mode in case of no mode