Will move to apr.cpp