In this update, we rewrote the internal codes to support the new framework