all the stuff inside here should be moved into CMF
