use one cst instn factory, and refactoring code