Refactor for gradle 2.1