is there not a better way to do this