some refactoring stuff