Moved function to help keep things organized.