Code refactoring and inspection