Code refactoring with analyzer