function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) {
        bool isPresale = isPresaleTime();
        uint tokensAmount = tokenStrategy.getTokenAmount(_weiAmount, isPresale);
        if (isPresale) {
            require(tokensUsedOnPresale.add(tokensAmount) <= tokenStrategy.tokensAvailableForPresale());
            tokensUsedOnPresale = tokensUsedOnPresale.add(tokensAmount);
        } else {
            require(tokensUsedOnSale.add(tokensAmount) <= tokenStrategy.tokensAvailableForSale());
            tokensUsedOnSale = tokensUsedOnSale.add(tokensAmount);
        }
        return tokensAmount;
    }