Moving scripts to lib