Update stripify.py

factorised code into functions