Refacto + style
Some changes