Refactored panel script and chrome part