refactor system service