refactoring and added sidebar