optimize option merging