began rewrite according to new functionalities