Compounds, compositions and methods for modulating the activity of nuclear receptors are provided. In particular, heterocyclic compounds are provided for modulating the activity of farnesoid X receptor (FXR), liver X receptor (LXR) and/or orphan nuclear receptors. In certain embodiments, the compounds are thiazolidinone derivatives.