def hard_retype(value):
    """
    tries to converts value to relevant type by re-typing

    :param value: value to be converted
    :type value: str (unicode)
    :return: re-typed value
    :rtype: int, float, bool, str
    """
    try:
        return int(value)
    except ValueError:
        try:
            return float(value)
        except ValueError:
            if value.lower() in ('true', 'false'):
                return value.lower() == 'true'
            return value