Remove unnecessary code repetition in edit cookbook details show/hide.