move ch5md to lib