Refactor some System boilerplate into ecs functions.