Moved script to external file