reconstuct repository and message handler