refactoring of sample project