Refactored priors into a function