reorganize the project structure and rewrite the makefile