Moved initialization stuff into constructor.