refactored sidebar et al.