-some refactoring