moved all guard statements out of execution file and into library