Move initialization out of constructor

It makes for simpler testing and a cleaner interface.