Code reorganization, use gradle