Refactored gate closing operation..