re-structure root and remove unnecessary code