cleaning up, upgrading js libs and refactoring for ts generics