moved event emitting and listening to component