Can we put this into it's own function?