refactor the sample project