DRY the code