Some more transformation code for JS