Cleaning up erc implementation