Reduce variable scope in init function