Move running foo into a function for better article presentation