Not sure about this, is there a better way?