Making the doctrine service optional