move script to external file