warning: partial rewrite
