Added few changes in the build.gradle

Added Few minor changes and also refractored the code