Added method to initialize components.