[CS] Remove some duplicate code