Redefined several functions on the JS side