upgraded java version to 1.7 and minor code refactor.