Refactored to allow dictionary capability.