refactoring to abstract the likelihood