refactor conditional

refactor initialization of resources dict