Cleaned up initialization process a bit.