remove unnecessary code

tabs
fix expand for diagrams