Remove duplicated functions and use mochiweb's ones