Extract entry point to refactoring into main.py