Refactoring & validation