Alot of initialization work.