Improved scripts modularity and ability to open/close unit menu