[Bug Fix] Replace boost::optional with unique ptr.

Boost optional doesn't work with move semantics.
[Detail] Do not do extra work.