refactor code to remove unncessary service call
undo refactoring.