Major refactor of panel