Adjust the code slightly

Simplify some useless parts and fix the bug of exam frame size when the
developers tools displayed.