modify factory
use pointer in case of rvalue references