Feature/rewrite