Reduce redundancy with opts object