A bit of cleanup
Make a not JS version