Moved sidebar setup code into separate file