RF: using 'with_metaclass' from utils.six for Python 2/3 compatibility.