refactored to remove some design shortcuts