Prevent certain part which may not be thread-safe
Refactor some methods
Use raise_exception instead of raise keyword
Update .travis.yml