Refactor to use SDL.