Format code and refine the directory structure