Encode: separate the entire project to lib and demo