optimize wasm code a little bit