Code inspection and refactoring