added main.py, refactored other files