extracted some settings/code to settings module, so it only runs once at module load