Towards a general theory of representation