Made it a bit more DRY