refactored it based on input from our team's review