reorganize and fix an issue