simplify code (use newer versions of code as template)