In Germany, prisons are institutions mainly for the execution of imprisonment sentences and youth custody, but they are also used for preventive and pre-trial detention. The purpose of all forms of imprisonment is the social reintegration  of ex-offenders. Under German law, the primary goal of prison is “to enable prisoners to lead a life of social responsibility free of crime upon release.” Successful reintegration is of course also seen as a way to ensure public safety.