some refactoring and minor readme+testing updates