make script more generic