WORKING - refactoring in progress