there has to be an easier way to do this