Refactor a bit of system manager