add a lot stuff in Entity and relevant tests