Code cleanup
More code cleanup and minor gradle file changes [ci skip]