l, educational, correctional, segregative, and other facilities, institutions and agencies, whether public or private, within the commonwealth wherever feasible, otherwise outside the commonwealth; provided however, that the department shall not transfer custody of any person who was committed to the department by a juvenile court or district court juvenile session and who is under eighteen to a p