Cleanup code, add some additional options.