Move more code from window to criteria_input.