Perhaps move some of this initialization logic into private functions?