Extracted init code to separate class.