use move semantics correctly in constructor