We study some particular modifications of gravity in search for a natural way to unify the gravitational and electromagnetic interaction. The certain components of connection in the appearing variants of the theory can be identified with electromagnetic potential. The methods of adding matter in the form of scalar and spinor fields are studied. In particular, the expansion of the local symmetry group up to GL(2, C) is explored, in which equations of Einstein, Maxwell and Dirac are reproduced for the theory with Weyl spinor.⋆