refactored to cater for changes in controllers