A bit of code optimization and cleanup.
Use only width and height to determine display orientation.