Restructured for spring, some bug fixed