Might need to still support duration as an optional parameter due to backward compatibility.