Merge pull request #15 from breese/handshake

Minor refactorings