Refactored file.

- Removed unused APIs. 
- Add isInvalidDisplay method.