updated erc and some file reorganization