Split into main module and example script