factoring gradle scripts