CAL-305 fix popover menu and clean code