rewrite dc and functionalization