Simple js improvements
Merge pull request #28 from dlion/optimize

Simple js improvements