refactor of connexion controller