Global refactoring (1st part)