Cleaned up the option mapping code a bit.