move global definitions to seperate file
add global script to index