Added more logic to removing internals from endgate declaratino file by modifying with more regex.