Multiple changes

- Refactored the implementation of entity.
- Added the default implementation of entity.