removed some dead code, renamed callback to postMessage