moved constants to settings
merged with changes from erc