Fix the issue when sidebar were not recognized by name and clean some code