Semiconductor device fabrication using etch stop layer