optional hashref for finer control