Refactor gradle build files.