remove some DRY code