1. Partially implemented the drawing of components and tabs.
2. A little refactoring