Shortened case statement and added wildcard option.