modularize the scripts