Added method commonInit for shared code during initialization