changed fetching algorithm
refactored spring configuration
minimal refactorings