Rewrited main