factor out the prelude