Broke into smaller functions