is there a better way to to do this?