refactored moveDoor()