cleans up DRY code