refactor methods.py in preparation with merge