Restructured code for gradle.