rename mode to type