add generic implementation for result mapping
upgraded java version to 1.7 and minor code refactor.