Code Cleanup & improved open in panel feature