factor out Dock
factor out Dock into header and cpp file