Improved ipc code