Finish working on the modal API.
Remove uneeded code.