Use a better API for this