Refactor code to release new version 2.0