Remove unsused code from handler