UPDATE: arrange code