Refactor to support setup.py install