Remove unnecessary funs and refactor in the mq