moved script outside of app dir to lib