refactor temporary variable