refactored resolutions logic into resolutions.js