Cleanup variable names + comments + add javadocs
Get rid of replica type from the code base