s: remove dupilicate code