Properly initializing spring