refactored and added gradle support scripts