code refactoring on sample projects