Reimplement licm
Reimplement licm
Reimplement licm
Move replace function to utils