rewrite most code and remove useless code
remove some files and organize most into folders