Integrate category optimization code