javascript: extracted common runtime