refactor the logic.
add get opt.
add data logs.