more rigorous constness and avoid copying

use c++11 moving more consequently and reduce mutable surface