Added Spring and refactorted