refactor receiving javascript
Merge pull request #11 from Ravenstine/receive_refactor

refactor receiving javascript