Refactor dock panel behaviours