create pushmode and flushmode to group modes and ignore redundant ones