Add panel title and refactor