Is there an easier way to do this