more helper methods, some refactoring...