refactor of get_output_cell