registration added and some file organization