Wrapped up and modularized stage1.