change controller using service class to make controller thin