changed history from deprecated to autowiring in constuctor