functional JS updates