consolitate into a function to keep it dry