Refactoring, move codes to sub dirs.