private static void PerformCommand() { if (CommandIsNotAllowed()) { return; } CommandExecutionResult result = null; try { result = CommandHandlerFactory .Create(_executionContext.Command.CommandType) .Execute(_executionContext.Command.Parameters, _executionContext.CurrentScreen.Model); } catch (Exception exception) { ExceptionScreen(exception); return; } _executionContext.CurrentScreen = result.NextScreenType.HasValue ? ScreenFactory.CreateScreen(_render, result.NextScreenType.Value, result.Model) : null; _executionContext.Command = null; _render.Clear(); }