refine dirs and makefile