def __new__(mcs, name, bases, attrs):
    """
        Validate state definition
        """
    if bases != (object,):
        if name.lower() != name and not attrs.get('abstract', False):
            raise Exception(
                'Please use lowercase names for state definitions (instead of {})'
                .format(name))
        if 'description' not in attrs and not attrs.get('abstract', False):
            raise Exception(
                'Please give a description to this state definition')
    if 'handler' in attrs and len(attrs['handler'].__code__.co_varnames) < 2:
        raise Exception('StateDefinition handler needs at least two arguments')
    if 'handler' in attrs:
        attrs['handler'] = classmethod(attrs['handler'])
    return type.__new__(mcs, name, bases, attrs)
