code refactoring on retrieve data from SC. Add Service to handle all the logic and remove this job from the controller