cleanded code; put some code into helper.py