refactored to reflect current thinking