remove null check in equals method, minor code fixes
refactor Constructor to Factory
remove Object return in script method
remove resetApi method and replace with dispose