Compact JS functions