some refacto to follow specs