refectore js and debug multi constructor