refactoring for entity-component design