change factory of elems to singleton