DRYer and more documentation