add shared memory object support (send/recv) and refactoring of code a little