Make sidebar configurable, refactor angular code