Some refacto and update the gemfile