refactor files into main.py