Refactor analysis and configuration generation