cleaned up last commit to be more DRY