some refactoring  (including stripping out unused methods)