re-organizate codes