This looks hacky. Can't we throw an exception?