Initial segments and end-extensions of models of arithmetic