Bran substrate can lead to some serious pest outbreaks, especially if not kept dry. Grain moths, however, can take very dry conditions. The life cycle takes three months to a year depending on the species so changing out the substrate should make a big difference as they have to start all over again. You may have to change out the substrate a few times over months to get rid of them. If you use a bran substrate you may want to change it on a regular basis every few months but even a relatively inert soil substrate may need to be changed every year or two if the moths continue to be an issue.