option mapping, and cleanup