Visual cleanup of keyDialog. Code is still a mess.