Restructured to support nodejs app