I'd make an intermediate variable to avoid calling form_list.keys() up to 3 times (same in get_prev_step())