Refactoring  - work in progress