refactore, remove objects not pythonic () in while