(b) Use deprivation of liberty only as a measure of last resort and for the shortest possible period of time; protect the rights of children deprived of their liberty, including the right to privacy; ensure that children remain in contact with their families while in the juvenile justice system;