improved external file build