Refactoring

(Live demo in Eclipse.)