code refactoring + check if dl_list is empty