Replace val with def to avoid duplicating data.