rebuilding js architecture