optimize option assignment