Started to replace some code by regex