Refactor 2. [WIP] Especially 4 Sergey