rewrite with more interface