Moved stuff from Process to seperate functions