Refactoring and feature detection