used fetch to clean up some code