Is there an easier way to do all of this?