Extracted from SyteJS.