Separate this project to a library and a sample