Collapsed style formatting into a function