refactored for gradle