promoted mode and algorithmmode to their own class