Fix another instance of resolve() bug and consolidate code