contract EscrowAccountCrowdsale is TimedCrowdsale {
  using SafeMath for uint256;
  EscrowVault public vault;
  /**
   * @dev Constructor, creates EscrowAccountCrowdsale.
   */
  function EscrowAccountCrowdsale() public {
    vault = new EscrowVault(_wallet);
  }
  /**
   * @dev Investors can claim refunds here if whitelisted is unsuccessful
   */
  function returnInvestoramount(address _beneficiary, uint256 _percentage) internal onlyOwner {
    vault.refund(_beneficiary);
  }

 /**
   * @dev Investors can claim refunds here if whitelisted is unsuccessful
   */
  function adminChargeForDebit(address _beneficiary, uint256 _adminCharge) internal onlyOwner {
    vault.debitForFailed(_beneficiary,_adminCharge);
  }

  function afterWhtelisted(address _beneficiary) internal onlyOwner{
      vault.closeAfterWhitelisted(_beneficiary);
  }
  
  function afterWhtelistedBuy(address _beneficiary) internal {
      vault.closeAfterWhitelisted(_beneficiary);
  }
  /**
   * @dev Overrides Crowdsale fund forwarding, sending funds to vault.
   */
  function _forwardFunds() internal {
    vault.deposit.value(msg.value)(msg.sender);
  }

}
/**
 * @title EscrowAccountCrowdsale.
 */
function adminChargeForDebit(address _beneficiary, uint256 _adminCharge) internal onlyOwner {
  vault.debitForFailed(_beneficiary,_adminCharge);
}

/**
 * @dev Investors can claim refunds here if whitelisted is unsuccessful
 */