Refactor

abstracted data from controller into service