implement custom entity system