a bit refacto