Use init function to instantiate essential things.