refactored code from snp & readme update