Refactor dock removal