Refactor for setup.py