move to files at package

move to files at package and need to modify some functions (commected
"TODO")