Provided herein are compounds of the formula (IV) as well as pharmaceutically acceptable salts thereof, wherein the substituents are as those disclosed in the specification. These compounds, and the pharmaceutical compositions containing them, are useful as MITF inhibitors, MITF pathway inhibitors and for the treatment of cancer.