make the code DRY
resolve conflict