some refactoriung