optimized directory structure, fix a minor bug