add CS and SB, refactoring