refactor resolve stuff