there must be an easier way