sidebar: refactor controller