Remove unnecessary codes in getAllTask