Replaced conditional with dictionary.