And he appointed, according to the judgment of David his father, the divisions of the priests for their service, and the Levites for their duties, to praise and serve before the priests, according to the matter of a day in its day, and the gatekeepers by their divisions at each gate; for thus David had commanded the man of God.