Helper functions from Lana.